package com.bykj.taketurns.utils;

import java.util.Iterator;
import java.util.Map;

/**
 * Created by Administrator on 2017/6/28.
 */

public class Constant {
    public static final String EXTRA_NAME="extra_data";

    public static final String JHC_SERVICE = "http://192.168.1.108/Jiecha/";
    public static final String EXTRA_FILE_NAME="extra_file_name";

    public class ServiceConstant {

        //首页视频
        public static final String HOME_URL = "storyVideoList";

        //首页文字(发现三级文字)
        public static final String HOME_TEXT_URL = "storyCharacterList?";

        //首页二级视频
        public static final String VIDO_SECONDARY_PAGE = "videoListAll?";

        //首页二级文字
        public static final String TEXT_SECONDARY_PAGE = "CharacterListAll?";

        //发现
        public static final String FIND_URL = "discovery";

        //发现二级视频
        public static final String FIND_SECONDARY_VIDEO = "discoveryByTypeid?";

        //发现二级文字
        public static final String FIND_SECONDARY_TEXT = "discovery2ByTypeid?";

        //发现三级视频
        public static final String FIND_THREE_VIDEO = "DiscoveryVideoList?";
        //用户界面
        public static final String PERSONAL_URL="setPerson?";

    }

    //拼接参数的方法
    public static String SetUrl(Map<String,String> map) {

        //声明int类型判断是第一个还是最后一个
        int index = 0;
        String url = "";

        Iterator<Map.Entry<String, String>> entries = map.entrySet().iterator();

        while(entries.hasNext()){

            Map.Entry<String, String> entry = entries.next();

            if (index == 0){
                url += entry.getKey()+"="+entry.getValue();
            }else {
                url += "&" +entry.getKey()+"="+entry.getValue();
            }
            index++;

        }

        return url;

    }
    public static class Param{
       public String key;
       public String value;
        public Param(String key,String value){
            this.key=key;
            this.value=value;
        }
    }

    public class APPlacationAcer {

        /**
         * 用户登陆的手机号码
         */
        public static final String MOBLE_PHONE_NUMBER = "moble_phone_number";

        /**
         * 用户登陆的id
         */
        public static final String LOGIN_USER_ID = "login_user_id";

        /**
         * 用户的名字
         */
        public static final String LOGIN_USER_NAME = "login_user_name";
        /**
         * 用户的头像地址
         */
        public static final String LOGIN_USER_IMAGE = "login_user_image";

        /**
         * 手势密码1.代表开2代表关，末日是开的。
         */
        public static final String LOGIN_USER_GESTURE = "login_user_gesture";


        /**
         * 师傅在登陆也没进入忘记密码的，1默认是在登陆页面进去，2在在安全中心进去的。
         */
        public static final String LOGIN_USER_FIRST_LOGN = "login_user_first_logn";

        /*
        * 记录上次加载刷新的事件*/
        public static final String CLASS_COURSE_TIME = "class_course_time";

        /**
         * 记录下载状态。
         */
        public static final String BUFFER_VIDEO_STATUE = "buffer_video_statue";

        /**
         * 记录是不是播放完成向服务器提交数据。
         */
        public static final String VIDEO_COMPLETE_COMMIT = "video_complete_commit";

        /**
         * 第一次启动页面。
         */
        public static final String FIRST_LOGIN_IMAGEVIEW = "first_login_imageview";

        /**
         * 视频播放页面当前是横屏还是竖屏。
         */
        public static final String VIDEO_VIEW_OPRIATION = "video_view_opriation";


        /**
         * 视频播放页面每两次直接发送的时间间隔。
         */
        public static final String VIDEO_VIEW_LONG_TIME = "video_view_long_time";
    }
}
